/*
 * Copyright (c) 2010-2011 NOO. All Rights Reserved.
 * [Id:RoleBean.java  2011-11-04 下午9:16 poplar.yfyang ]
 */
package org.mumu.pawn.beans.bam;

import org.mumu.pawn.cmps.RoleCmp;
import org.mumu.pawn.fm.dm.LazyPawnDataModel;
import org.mumu.pawn.domain.Role;
import org.mumu.pawn.fm.BaseBean;
import org.mumu.pawn.fm.util.QueryField;

import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.List;

/**
 * <p>
 * .
 * </p>
 *
 * @author poplar.yfyang
 * @version 1.0 2011-11-04 下午9:16
 * @since JDK 1.5
 */
@Named
@ViewScoped
public class RoleBean extends BaseBean<Role> {
    private static final long serialVersionUID = 3043100719357317398L;

    @Override
    protected LazyPawnDataModel<Role> builderDataModel() {
        return roleCmp.getRoleDataModal();
    }

    @Override
    protected void doRemove() {
        roleCmp.deleteRole(this.getEntity().getId());
    }

    @Override
    protected void doSave() {
        roleCmp.saveOrUpdateRole(this.getEntity());
    }

    @Override
    protected List<QueryField> initQueryFields() {
        return null;
    }

    @Inject
    private RoleCmp roleCmp;


}
